<template>
<span class="bh-avatar" :class="[circleClass]">
	<bh-icon v-if='name' :name='name'></bh-icon>
	<img v-else-if='src' :src='src' />
	<slot v-else></slot>
</span>
</template>

<script>
export default {
	name: 'bh-avatar',
	props: {
		name: String,
		src: String,
	},
	data() {
		return {
			visible: true,
		}
	},
	methods: {
		close() {
			this.visible = false;
			this.$emit('close');
		},
	},
	computed: {
		circleClass() {
			if(this.src) {
				return '';
			}
			return `bh-avatar--circle`;
		},
	},
}
</script>
